3.6.50 \(\int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2 \, dx\) [550]

3.6.50.1 Optimal result
3.6.50.2 Mathematica [A] (verified)
3.6.50.3 Rubi [A] (verified)
3.6.50.4 Maple [B] (verified)
3.6.50.5 Fricas [C] (verification not implemented)
3.6.50.6 Sympy [F]
3.6.50.7 Maxima [F]
3.6.50.8 Giac [F]
3.6.50.9 Mupad [F(-1)]

3.6.50.1 Optimal result

Integrand size = 25, antiderivative size = 109 \[ \int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2 \, dx=-\frac {14 a b (e \cos (c+d x))^{3/2}}{15 d e}+\frac {2 \left (5 a^2+2 b^2\right ) \sqrt {e \cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d \sqrt {\cos (c+d x)}}-\frac {2 b (e \cos (c+d x))^{3/2} (a+b \sin (c+d x))}{5 d e} \]

output
-14/15*a*b*(e*cos(d*x+c))^(3/2)/d/e-2/5*b*(e*cos(d*x+c))^(3/2)*(a+b*sin(d* 
x+c))/d/e+2/5*(5*a^2+2*b^2)*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c 
)*EllipticE(sin(1/2*d*x+1/2*c),2^(1/2))*(e*cos(d*x+c))^(1/2)/d/cos(d*x+c)^ 
(1/2)
 
3.6.50.2 Mathematica [A] (verified)

Time = 0.52 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.73 \[ \int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2 \, dx=\frac {\sqrt {e \cos (c+d x)} \left (6 \left (5 a^2+2 b^2\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )-2 b \cos ^{\frac {3}{2}}(c+d x) (10 a+3 b \sin (c+d x))\right )}{15 d \sqrt {\cos (c+d x)}} \]

input
Integrate[Sqrt[e*Cos[c + d*x]]*(a + b*Sin[c + d*x])^2,x]
 
output
(Sqrt[e*Cos[c + d*x]]*(6*(5*a^2 + 2*b^2)*EllipticE[(c + d*x)/2, 2] - 2*b*C 
os[c + d*x]^(3/2)*(10*a + 3*b*Sin[c + d*x])))/(15*d*Sqrt[Cos[c + d*x]])
 
3.6.50.3 Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.03, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.360, Rules used = {3042, 3171, 27, 3042, 3148, 3042, 3121, 3042, 3119}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2dx\)

\(\Big \downarrow \) 3171

\(\displaystyle \frac {2}{5} \int \frac {1}{2} \sqrt {e \cos (c+d x)} \left (5 a^2+7 b \sin (c+d x) a+2 b^2\right )dx-\frac {2 b (e \cos (c+d x))^{3/2} (a+b \sin (c+d x))}{5 d e}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{5} \int \sqrt {e \cos (c+d x)} \left (5 a^2+7 b \sin (c+d x) a+2 b^2\right )dx-\frac {2 b (e \cos (c+d x))^{3/2} (a+b \sin (c+d x))}{5 d e}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \int \sqrt {e \cos (c+d x)} \left (5 a^2+7 b \sin (c+d x) a+2 b^2\right )dx-\frac {2 b (e \cos (c+d x))^{3/2} (a+b \sin (c+d x))}{5 d e}\)

\(\Big \downarrow \) 3148

\(\displaystyle \frac {1}{5} \left (\left (5 a^2+2 b^2\right ) \int \sqrt {e \cos (c+d x)}dx-\frac {14 a b (e \cos (c+d x))^{3/2}}{3 d e}\right )-\frac {2 b (e \cos (c+d x))^{3/2} (a+b \sin (c+d x))}{5 d e}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\left (5 a^2+2 b^2\right ) \int \sqrt {e \sin \left (c+d x+\frac {\pi }{2}\right )}dx-\frac {14 a b (e \cos (c+d x))^{3/2}}{3 d e}\right )-\frac {2 b (e \cos (c+d x))^{3/2} (a+b \sin (c+d x))}{5 d e}\)

\(\Big \downarrow \) 3121

\(\displaystyle \frac {1}{5} \left (\frac {\left (5 a^2+2 b^2\right ) \sqrt {e \cos (c+d x)} \int \sqrt {\cos (c+d x)}dx}{\sqrt {\cos (c+d x)}}-\frac {14 a b (e \cos (c+d x))^{3/2}}{3 d e}\right )-\frac {2 b (e \cos (c+d x))^{3/2} (a+b \sin (c+d x))}{5 d e}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\frac {\left (5 a^2+2 b^2\right ) \sqrt {e \cos (c+d x)} \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}dx}{\sqrt {\cos (c+d x)}}-\frac {14 a b (e \cos (c+d x))^{3/2}}{3 d e}\right )-\frac {2 b (e \cos (c+d x))^{3/2} (a+b \sin (c+d x))}{5 d e}\)

\(\Big \downarrow \) 3119

\(\displaystyle \frac {1}{5} \left (\frac {2 \left (5 a^2+2 b^2\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {e \cos (c+d x)}}{d \sqrt {\cos (c+d x)}}-\frac {14 a b (e \cos (c+d x))^{3/2}}{3 d e}\right )-\frac {2 b (e \cos (c+d x))^{3/2} (a+b \sin (c+d x))}{5 d e}\)

input
Int[Sqrt[e*Cos[c + d*x]]*(a + b*Sin[c + d*x])^2,x]
 
output
((-14*a*b*(e*Cos[c + d*x])^(3/2))/(3*d*e) + (2*(5*a^2 + 2*b^2)*Sqrt[e*Cos[ 
c + d*x]]*EllipticE[(c + d*x)/2, 2])/(d*Sqrt[Cos[c + d*x]]))/5 - (2*b*(e*C 
os[c + d*x])^(3/2)*(a + b*Sin[c + d*x]))/(5*d*e)
 

3.6.50.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3119
Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)* 
(c - Pi/2 + d*x), 2], x] /; FreeQ[{c, d}, x]
 

rule 3121
Int[((b_)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*Sin[c + d*x]) 
^n/Sin[c + d*x]^n   Int[Sin[c + d*x]^n, x], x] /; FreeQ[{b, c, d}, x] && Lt 
Q[-1, n, 1] && IntegerQ[2*n]
 

rule 3148
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x 
_)]), x_Symbol] :> Simp[(-b)*((g*Cos[e + f*x])^(p + 1)/(f*g*(p + 1))), x] + 
 Simp[a   Int[(g*Cos[e + f*x])^p, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && 
 (IntegerQ[2*p] || NeQ[a^2 - b^2, 0])
 

rule 3171
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x 
_)])^(m_), x_Symbol] :> Simp[(-b)*(g*Cos[e + f*x])^(p + 1)*((a + b*Sin[e + 
f*x])^(m - 1)/(f*g*(m + p))), x] + Simp[1/(m + p)   Int[(g*Cos[e + f*x])^p* 
(a + b*Sin[e + f*x])^(m - 2)*(b^2*(m - 1) + a^2*(m + p) + a*b*(2*m + p - 1) 
*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f, g, p}, x] && NeQ[a^2 - b^2, 0] 
 && GtQ[m, 1] && NeQ[m + p, 0] && (IntegersQ[2*m, 2*p] || IntegerQ[m])
 
3.6.50.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(250\) vs. \(2(121)=242\).

Time = 5.22 (sec) , antiderivative size = 251, normalized size of antiderivative = 2.30

method result size
default \(-\frac {2 e \left (24 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-24 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+40 \left (\sin ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b +6 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-15 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a^{2}-6 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b^{2}-40 a b \left (\sin ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+10 \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) a b \right )}{15 \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) e +e}\, d}\) \(251\)
parts \(\frac {2 a^{2} \sqrt {e \left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, e \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-e \left (2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {e \left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right )}\, d}+\frac {4 b^{2} \sqrt {e \left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, e \left (4 \left (\cos ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-8 \left (\cos ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+5 \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-\cos \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 \sqrt {-e \left (2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {e \left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right )}\, d}-\frac {4 a b \left (e \cos \left (d x +c \right )\right )^{\frac {3}{2}}}{3 d e}\) \(362\)

input
int((a+b*sin(d*x+c))^2*(e*cos(d*x+c))^(1/2),x,method=_RETURNVERBOSE)
 
output
-2/15/sin(1/2*d*x+1/2*c)/(-2*sin(1/2*d*x+1/2*c)^2*e+e)^(1/2)*e*(24*cos(1/2 
*d*x+1/2*c)*sin(1/2*d*x+1/2*c)^6*b^2-24*cos(1/2*d*x+1/2*c)*sin(1/2*d*x+1/2 
*c)^4*b^2+40*sin(1/2*d*x+1/2*c)^5*a*b+6*cos(1/2*d*x+1/2*c)*sin(1/2*d*x+1/2 
*c)^2*b^2-15*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2) 
*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))*a^2-6*(sin(1/2*d*x+1/2*c)^2)^(1/2)* 
(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))*b^2 
-40*a*b*sin(1/2*d*x+1/2*c)^3+10*sin(1/2*d*x+1/2*c)*a*b)/d
 
3.6.50.5 Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.10 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.16 \[ \int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2 \, dx=-\frac {3 \, \sqrt {2} {\left (-5 i \, a^{2} - 2 i \, b^{2}\right )} \sqrt {e} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) + 3 \, \sqrt {2} {\left (5 i \, a^{2} + 2 i \, b^{2}\right )} \sqrt {e} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) + 2 \, {\left (3 \, b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 10 \, a b \cos \left (d x + c\right )\right )} \sqrt {e \cos \left (d x + c\right )}}{15 \, d} \]

input
integrate((a+b*sin(d*x+c))^2*(e*cos(d*x+c))^(1/2),x, algorithm="fricas")
 
output
-1/15*(3*sqrt(2)*(-5*I*a^2 - 2*I*b^2)*sqrt(e)*weierstrassZeta(-4, 0, weier 
strassPInverse(-4, 0, cos(d*x + c) + I*sin(d*x + c))) + 3*sqrt(2)*(5*I*a^2 
 + 2*I*b^2)*sqrt(e)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos( 
d*x + c) - I*sin(d*x + c))) + 2*(3*b^2*cos(d*x + c)*sin(d*x + c) + 10*a*b* 
cos(d*x + c))*sqrt(e*cos(d*x + c)))/d
 
3.6.50.6 Sympy [F]

\[ \int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2 \, dx=\int \sqrt {e \cos {\left (c + d x \right )}} \left (a + b \sin {\left (c + d x \right )}\right )^{2}\, dx \]

input
integrate((a+b*sin(d*x+c))**2*(e*cos(d*x+c))**(1/2),x)
 
output
Integral(sqrt(e*cos(c + d*x))*(a + b*sin(c + d*x))**2, x)
 
3.6.50.7 Maxima [F]

\[ \int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2 \, dx=\int { \sqrt {e \cos \left (d x + c\right )} {\left (b \sin \left (d x + c\right ) + a\right )}^{2} \,d x } \]

input
integrate((a+b*sin(d*x+c))^2*(e*cos(d*x+c))^(1/2),x, algorithm="maxima")
 
output
integrate(sqrt(e*cos(d*x + c))*(b*sin(d*x + c) + a)^2, x)
 
3.6.50.8 Giac [F]

\[ \int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2 \, dx=\int { \sqrt {e \cos \left (d x + c\right )} {\left (b \sin \left (d x + c\right ) + a\right )}^{2} \,d x } \]

input
integrate((a+b*sin(d*x+c))^2*(e*cos(d*x+c))^(1/2),x, algorithm="giac")
 
output
integrate(sqrt(e*cos(d*x + c))*(b*sin(d*x + c) + a)^2, x)
 
3.6.50.9 Mupad [F(-1)]

Timed out. \[ \int \sqrt {e \cos (c+d x)} (a+b \sin (c+d x))^2 \, dx=\int \sqrt {e\,\cos \left (c+d\,x\right )}\,{\left (a+b\,\sin \left (c+d\,x\right )\right )}^2 \,d x \]

input
int((e*cos(c + d*x))^(1/2)*(a + b*sin(c + d*x))^2,x)
 
output
int((e*cos(c + d*x))^(1/2)*(a + b*sin(c + d*x))^2, x)